package com.jf.ai.util;

import com.jf.ai.service.AudioService;
import kotlin.Triple;
import okhttp3.internal.http.RetryAndFollowUpInterceptor;

import java.io.BufferedReader;
import java.io.FileOutputStream;
import java.nio.ByteBuffer;

/**
 * Created with IntelliJ IDEA
 * Description:
 * User:22954
 * Date:2025-06-17
 * Time:17:30
 */
public class FileUtil {
    private static final String PATH = AudioService.class.getClassLoader().getResource("").getPath();

    public static void writeToFile(String fileName, ByteBuffer byteBuffer) {
        try(FileOutputStream fos = new FileOutputStream(PATH + fileName,  true)) {
            fos.write(byteBuffer.array());
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

}
